package com.yang;

import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

import com.yang.dao.UserDao;

@WebService(endpointInterface = "com.yang.LoginInterFace",name = "loginInterFace", targetNamespace = "http://www.yang.com")
public class LoginService implements LoginInterFace{

	UserDao ud=new UserDao();
	@Override
	@WebResult(name = "result")
	public User login(
			@WebParam(name = "name", targetNamespace = "http://www.yang.com", partName = "parameters") String name,
			@WebParam(name = "password", targetNamespace = "http://www.yang.com", partName = "parameters") String password) {
		return ud.findUser(name, password);
	}

	public User findByName(String name) {
		return ud.findUser(name);
	}

	public boolean addUser(String name, String password) {
		// TODO Auto-generated method stub
		return ud.add(name,password);
	}

	public boolean delUser(int id) {
		return ud.delUser(id);
	}

	public boolean addmin(int id) {
		return ud.addmin(id);
	}


}
